class_name BaseComponent
extends Node2D

#region 属性
# 初始化优先级，越小越早初始化
@export var priority:int = 0
@export var init_additional_effects:Array[AdditionalEffect]
var inited:bool = false
#endregion
#region 字段
var component_name:String:
	get:
		return get_script().get_global_name()
var entity:Entity:
	get:
		if not entity:
			for child in get_parent().get_children():
				if child is Entity:
					entity = child
					break
		return entity
#endregion
#region 信号
#endregion

#region 基类方法
#endregion
#region 公共方法
func init_component(args:Dictionary = {}):
	inited = true
func after_init_component():
	for additional_effect:AdditionalEffect in init_additional_effects:
			additional_effect.init({Target = entity,Owner = self})
	for additional_effect:AdditionalEffect in init_additional_effects:
			additional_effect.excute()
func get_entity() -> Entity:
	return entity
#endregion
#region 私有方法
#endregion
#region 生命周期函数
#endregion
